home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 6
/
CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso
/
cucd
/
readers
/
utils
/
gui4cli
/
demos
/
sfx.gc
< prev
next >
Wrap
Text File
|
1996-10-28
|
4KB
|
139 lines
G4C - SFX gui - by dck - 13/1/96
; GUI for setting the parameters of the SFX samples player.
; This GUI (like ppshow.gc) is supposed to be loaded and operated through
; the MMedia GUI, but can also work on its own.
WINBIG 160 14 350 143 "SFX 2.4"
wintype 11110001 ; Resize away
;-------------> Some boxes here and there..
BOX 10 50 330 21 IN ICONDROP
BOX 10 74 150 43 IN RIDGE
BOX 189 74 150 43 IN RIDGE
;BOX 20 80 130 31 OUT ICONDROP
;--------------> Make this window an AppWindow
; If icons are dropped into it we put them into the ppsmod variable and
; update the TEXT displays in MMedia.gc and here.
xAppWindow ppsmod
if $ppsmod > ""
update sfx.gc 2 $ppsmod
update MMedia.gc 2 $ppsmod
endif
;--------------> Upon Loading, we check if MMedia.gc is loaded or not.
; If loaded, we update our filename, as it may have changed from MMedia.gc
; Otherwise, we set the default values of our variables.
xONLOAD
SetGad sfx.gc 10 OFF ; Volume control is OFF
SetGad sfx.gc 12 OFF ; Hz control is OFF
IfExists GUI MMedia.gc
update sfx.gc 2 $ppsmod
else
setvar ppsmod "" ; Name of music file
setvar ppsleft -l ; Left speacker
setvar ppsright -r ; Right speacker
setvar ppsvol 64 ; Sample volume
setvar ppsVolGad "" ; Volume slider is off
setvar ppsrep 100 ; No of times to repeat sample
setvar ppsRepGad "-c 100" ; Command line option for repeat 100 times
setvar ppshz 30000 ; Sample rate (speed)
setvar ppsHzGad "" ; Rate slider is off
endif
;--------------> On Opening we refresh the file name display, as it may
; have been changed by MMedia.gc
xONOPEN
if $ppsmod = ""
update sfx.gc 2 "No file chosen."
else
update sfx.gc 2 "$ppsmod"
endif
;==================> Checkbox buttons for ON/OFF parameters
xCHECKBOX 300 55 26 11 "RIGHT" ppsright "-r" "" ON
xCHECKBOX 25 55 26 11 "LEFT" ppsleft "-l" "" ON
GadTitle RIGHT
xCHECKBOX 305 78 26 11 FromDisk ppsdisk -d "" OFF
xCHECKBOX 305 90 26 11 Script ppsscript -s "" OFF
xCHECKBOX 305 102 26 11 Quiet ppsquiet -q "" OFF
;=================> Sliders for repeat, volume and sample rate.
; The checkboxes next to them, denote whether options are on or off.
;----> Volume
xHSLIDER 40 5 220 12 "" ppsvol 1 64 64 "%2ld Vol."
GadId 10
setvar ppsVolGad "-v $ppsvol"
xCHECKBOX 10 5 26 11 "" ppsVolGad "-v $ppsvol" "" OFF
if $ppsVolGad = ""
SetGad sfx.gc 10 OFF
else
SetGad sfx.gc 10 ON
endif
;----> Times
xHSLIDER 40 20 220 12 "" ppsrep 1 200 100 "%3ld Times"
GadId 11
setvar ppsRepGad "-c $ppsrep"
xCHECKBOX 10 20 26 11 "" ppsRepGad "-c $ppsrep" "" ON
if $ppsRepGad = ""
SetGad sfx.gc 11 OFF
else
SetGad sfx.gc 11 ON
endif
;----> Herz - Hz can go from 0-65530 - we set the slider for 0-6553 range
; and append a 0 to the value, so we get the correct value.
; We do this because the range is far too big to be usefull.
xHSLIDER 40 35 220 12 "" ppshz 6 6553 3200 "%4ldx10Hz"
GadId 12
AppVar ppshz 0
setvar ppsHzGad "-p $ppshz"
xCHECKBOX 10 35 26 11 "" ppsHzGad "-p $ppshz" "" OFF
if $ppsHzGad = ""
SetGad sfx.gc 12 OFF
else
SetGad sfx.gc 12 ON
endif
;=====================> Icon acting as the "Play" button
xICON 54 83 GUIs:info/play
if $ppsmod != ""
RUN 'c:sfx >NIL: $ppsVolGad $ppsRepGad $ppsHzGad $ppsleft $ppsright $ppsscript $ppsdisk $ppsquiet $ppsmod'
endif
;=====================> button for file requester
xBUTTON 10 120 20 15 "F"
ReqFile -1 -1 300 -40 "Choose Music" LOAD ppsmod sys:
if $ppsmod = ""
update sfx.gc 2 "No file chosen"
update MMedia.gc 2 "No Music file chosen"
else
update sfx.gc 2 "$ppsmod"
update MMedia.gc 2 "$ppsmod"
endif
;====================> Text box for displaying the chosen file
TEXT 35 120 305 15 "No Music file chosen" 150 BOX
GADID 2